package com.fw.filter;

import com.fw.util.SessionUser;
import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

public class LoginFilter implements Interceptor{
	@Override
	public void intercept(Invocation inv) {
		SessionUser sessionUser =	inv.getController().getSessionAttr("sessionUser");
		if(sessionUser == null)
			inv.getController().redirect("/login.jsp");
		else inv.invoke();
	}

}
